![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Node.js module that tells you when your project npm dependencies are out of date.
Node.js module that tells you when your package NPM dependencies are out of date.
Install Node.js.
Install david:
cd /your/project/directory
npm install david
Use:
var david = require('david');
// Your package.json
var manifest = {
name: 'xxx',
dependencies: {
'aaa': '~0.0.0',
'bbb': '~0.0.0'
},
devDependencies: {
'yyy': '~0.0.0',
'zzz': '~0.0.0'
}
};
david.getDependencies(manifest, function (er, deps) {
console.log('latest dependencies information for', manifest.name);
listDependencies(deps);
});
david.getDependencies(manifest, { dev: true }, function (er, deps) {
console.log('latest devDependencies information for', manifest.name);
listDependencies(deps);
});
david.getUpdatedDependencies(manifest, function (er, deps) {
console.log('dependencies with newer versions for', manifest.name);
listDependencies(deps);
});
david.getUpdatedDependencies(manifest, { dev: true }, function (er, deps) {
console.log('devDependencies with newer versions for', manifest.name);
listDependencies(deps);
});
david.getUpdatedDependencies(manifest, { stable: true }, function (er, deps) {
console.log('dependencies with newer STABLE versions for', manifest.name);
listDependencies(deps);
});
david.getUpdatedDependencies(manifest, { dev: true, stable: true }, function (er, deps) {
console.log('devDependencies with newer STABLE versions for', manifest.name);
listDependencies(deps);
});
function listDependencies(deps) {
Object.keys(deps).forEach(function(depName) {
var required = deps[depName].required || '*';
var stable = deps[depName].stable || 'None';
var latest = deps[depName].latest;
console.log('%s Required: %s Stable: %s Latest: %s', depName, required, stable, latest);
});
}
Both getDependencies
and getUpdatedDependencies
return an object result,
whose keys are package names. The values are objects which contain the following properties:
required
- The version required according to the manifeststable
- The latest stable version availablelatest
- The latest version available (including build and patch versions)If you install David globally with npm install -g david
, you can run david
in your project directory to see which dependencies are out of date.
You can also run david --global
to see your outdated global dependencies.
To update all your project dependencies to the latest stable versions,
and save to your package.json
, run:
david update
You can also update global dependencies to latest versions:
david update --global
To update all your project dependencies to the latest versions
(including unstable versions), pass the --unstable
flag:
david update --unstable
Use an alternate reigstry:
david update --registry http://registry.nodejitsu.com/
--warn404
option to print errors but not abort-r, --registry
option to use alternate npm registrydavid update
uses "^" as per https://github.com/npm/npm/issues/4587semverext.js
. The gtr
function is now available in semver
david update [module]
optionalDependencies
and peerDependencies
--unstable
flag to view/update to latest unstable dependency versionsdavid update
to update dependencies to latest stable versions and save to your project package.json
setImmediate
instead of process.nextTick
. David now requires Node.js 0.10.x--global
flag to find outdated global dependenciesdevDependencies
onlyStable
param to getUpdatedDependencies
to filter by dependencies that are updated and stable5.0.0 - 2014-09-22
FAQs
Node.js module that tells you when your project npm dependencies are out of date.
The npm package david receives a total of 1,373 weekly downloads. As such, david popularity was classified as popular.
We found that david demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.